/*
 * Created on Feb 25, 2005
 */
package com.scalar.chiptrack.finance.openpo.actioncommands;

import com.scalar.chiptrack.ChipTrackExtendedAction;
import com.scalar.chiptrack.commons.Constants;

/**
 * @author Ravikanth
**/
public class ReceiptSearchCommandFactory implements Constants
{

	private static ReceiptSearchCommandFactory sRscfactory;

	public synchronized static ReceiptSearchCommandFactory getInstance()
	{
		if ( sRscfactory == null )
		{
			sRscfactory = new ReceiptSearchCommandFactory();
		}
		return sRscfactory;
	}

	private ReceiptSearchCommandFactory()
	{
	}

	/**
	 * Returns the ActionCommand Class that implements businnes logic for the given action
	 *
	 * @param action
	 * @return
	 */
	public static ChipTrackExtendedAction getActionCommand( String action )
	{
		if ( ACTION_PURCHASE_ORDER_RECEIPT_SEARCH.equalsIgnoreCase( action ) )
		{
			return new ReceiptSearchCommand();
		}
		if( ACTION_CREATE_NEW_PURCHASE_ORDER_RECEIPT_SEARCH.equalsIgnoreCase( action ) )
		{
			return new ReceiptCreateNewSearchCommand();
		}
		return null;
	}
}
